<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStationBillsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('station_bills', function (Blueprint $table) {
            $table->increments('id');
            $table->string('start_time')->comment('账单开始日期');
            $table->string('end_time')->comment('账单结算日期');
            $table->unsignedInteger('service_id')->index()->comment('服务站ID');
            $table->unsignedInteger('total_sign')->default(0)->comment('签收件总数');
            $table->decimal('charge', 10, 2)->default(0.00)->comment('手续费');
            $table->decimal('total_income', 10, 2)->default(0.00)->comment('总收入');
            $table->unsignedTinyInteger('status')->default(0)->comment(' 状态    0未结算   1已结算');
            $table->string('number')->nullable()->comment('交易流水号');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('station_bills');
    }
}
